<template>
  <ul class="todo-main">
    <transition-group
      appear
      name="animate__animated animate__bounce"
      enter-active-class="animate__fadeIn"
      leave-active-class="animate__flash"
    >
      <MyItem
        v-for="todoObj in todos"
        :key="todoObj.id"
        :todoObj="todoObj"
        :checkTodo="checkTodo"
        :deleteTodo="deleteTodo"
      ></MyItem>
    </transition-group>
  </ul>
</template>

<script>
//安装nanoid后直接引用
// import { nanoid } from "nanoid";

// 安装animate.css后引用
import "animate.css";

import MyItem from "./MyItem.vue";
export default {
  name: "MyList",
  props: ["todos", "checkTodo", "deleteTodo"],
  data() {
    return {};
  },
  components: { MyItem },
};
</script>

<style>
/*main*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
</style>